package network;

import java.io.IOException;
import java.util.Map;

public class Authentication {
    private static Map<String, String> authData;

    public static void loadAuthData() throws IOException {
        authData = FileConnection.loadAuthData();
    }

    public static boolean isValidLogin(String login) {
        return authData.containsKey(login);
    }

    public static boolean isValidPasswordForCurrentLogin(String login, String password) {
        return authData.containsKey(login) && authData.get(login).equals(password);
    }
}
